package net.lahuobao.mall.entity.admin;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Lenovo on 2017/3/27.
 */
@Entity
@Table(name = "user", schema = "lahuobao")
@DynamicUpdate(true)
@DynamicInsert(true)
public class LhbUserEntity implements Serializable{

    private Integer userId;

    private String userName;

    private String password;

    private String fullname;

    private String photo;

    private String idcard;

    private String idcardImg;

    private Date regDatetime;

    private Date lastLogin;

    private Short validateState;

    private Short state;

    private Date validateDatetime;

    private Short type;

    private String idcardImgTwo;

    private Short roleType;

    private MallProjectUserEntity projectUserEntity;
    @OneToOne
    @JoinColumn(name = "user_id",referencedColumnName = "userid")
    public MallProjectUserEntity getProjectUserEntity() {
        return projectUserEntity;
    }

    public void setProjectUserEntity(MallProjectUserEntity projectUserEntity) {
        this.projectUserEntity = projectUserEntity;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name ="USER_ID",nullable=false,precision=10,scale=0)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    @Column(name ="USER_NAME")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }
    @Column(name ="PASSWORD")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }
    @Column(name ="FULLNAME")
    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname == null ? null : fullname.trim();
    }
    @Column(name ="PHOTO")
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo == null ? null : photo.trim();
    }
    @Column(name ="IDCARD")
    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard == null ? null : idcard.trim();
    }
    @Column(name ="IDCARD_IMG")
    public String getIdcardImg() {
        return idcardImg;
    }

    public void setIdcardImg(String idcardImg) {
        this.idcardImg = idcardImg == null ? null : idcardImg.trim();
    }
    @Column(name ="REG_DATETIME")
    public Date getRegDatetime() {
        return regDatetime;
    }

    public void setRegDatetime(Date regDatetime) {
        this.regDatetime = regDatetime;
    }
    @Column(name ="LAST_LOGIN")
    public Date getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin) {
        this.lastLogin = lastLogin;
    }
    @Column(name ="VALIDATE_STATE")
    public Short getValidateState() {
        return validateState;
    }

    public void setValidateState(Short validateState) {
        this.validateState = validateState;
    }
    @Column(name ="STATE")
    public Short getState() {
        return state;
    }

    public void setState(Short state) {
        this.state = state;
    }
    @Column(name ="VALIDATE_DATETIME")
    public Date getValidateDatetime() {
        return validateDatetime;
    }

    public void setValidateDatetime(Date validateDatetime) {
        this.validateDatetime = validateDatetime;
    }
    @Column(name ="TYPE")
    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }
    @Column(name ="IDCARD_IMG_TWO")
    public String getIdcardImgTwo() {
        return idcardImgTwo;
    }

    public void setIdcardImgTwo(String idcardImgTwo) {
        this.idcardImgTwo = idcardImgTwo == null ? null : idcardImgTwo.trim();
    }
    @Column(name ="ROLE_TYPE")
    public Short getRoleType() {
        return roleType;
    }

    public void setRoleType(Short roleType) {
        this.roleType = roleType;
    }
}
